package com.wondersgroup.retrofittest.mall;

import android.os.Bundle;
import android.support.annotation.Nullable;

import com.hss.mvp.base.BaseActivty;
import com.wondersgroup.retrofittest.R;
import com.wondersgroup.retrofittest.mall.contract.MallContract;
import com.wondersgroup.retrofittest.mall.presenter.MallPresenterImpl;

/**
 * Created by Administrator on 2017/2/10.
 */

public class MallActivity extends BaseActivty{

    MallContract.Presenter presenter;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_base);
        initData();
        initView();
    }

    @Override
    public void initData() {
        super.initData();
        presenter=new MallPresenterImpl();
    }

    @Override
    public void initView() {
        super.initView();
        MallFragment fragment = null;
        try {
            fragment = addFragment2Frame(MallFragment.class,R.id.contentFrame);
            fragment.setPresenter(presenter);
        } catch (IllegalAccessException e) {
            e.printStackTrace();
        } catch (InstantiationException e) {
            e.printStackTrace();
        }

    }


    @Override
    public void destoryRes() {
        super.destoryRes();
        presenter.destoryRes();
    }
}
